package com.shamar.blog.dto;

import com.shamar.blog.entity.BlogAdmin;
import com.shamar.blog.enums.BlogAdminStateEnum;

import java.util.List;

/**
 * 封装执行后结果
 */
public class BlogAdminExecution {

	// 结果状态
	private int state;

	// 状态标识
	private String stateInfo;

	// 用户数量
	private int count;

	// 操作的用户（修改用户的时候用）
	private BlogAdmin blogAdmin;

	// 获取的Admin列表(查询用户的时候用)
	private List<BlogAdmin> blogAdminList;

	//空参构造器
	public BlogAdminExecution() {
	}

	// 失败的构造器
	public BlogAdminExecution(BlogAdminStateEnum stateEnum) {
		this.state = stateEnum.getState();
		this.stateInfo = stateEnum.getStateInfo();
	}

	// 成功的构造器,返回单一用户
	public BlogAdminExecution(BlogAdminStateEnum stateEnum, BlogAdmin blogAdmin) {
		this.state = stateEnum.getState();
		this.stateInfo = stateEnum.getStateInfo();
		this.blogAdmin = blogAdmin;
	}

	// 成功的构造器,返回用户列表
	public BlogAdminExecution(BlogAdminStateEnum stateEnum, List<BlogAdmin> blogAdminList) {
		this.state = stateEnum.getState();
		this.stateInfo = stateEnum.getStateInfo();
		this.blogAdminList = blogAdminList;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public String getStateInfo() {
		return stateInfo;
	}

	public void setStateInfo(String stateInfo) {
		this.stateInfo = stateInfo;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public BlogAdmin getBlogAdmin() {
		return blogAdmin;
	}

	public void setBlogAdmin(BlogAdmin blogAdmin) {
		this.blogAdmin = blogAdmin;
	}

	public List<BlogAdmin> getBlogAdminList() {
		return blogAdminList;
	}

	public void setBlogAdminList(List<BlogAdmin> blogAdminList) {
		this.blogAdminList = blogAdminList;
	}
}